//
//  OrderDetailMiddleCell.m
//  didacar
//
//  Created by 度周末网络-王腾 on 16/1/11.
//  Copyright © 2016年 dzmmac. All rights reserved.
//

#import "OrderDetailMiddleCell.h"

@implementation OrderDetailMiddleCell

-(void)awakeFromNib{
    UIView *topLine = [CommoneTools createLineWithFrame:CGRectMake(0, 159, [UIScreen width], 0.45)];
    
    [self.bgView addSubview:topLine];
    
    UIView *bottomLine = [CommoneTools createLineWithFrame:CGRectMake(0, 0, [UIScreen width], 0.45)];
    
    [self.bgView addSubview:bottomLine];
    
}

-(void)setOrderDetailRegularBusModel:(OrderDetailRegularBusModel *)entity{
    if (entity == nil) {
        return;
    }

    // 票数量
    self.ticketCount.text= [NSString stringWithFormat:@"%@张",@(entity.OrderNum).stringValue];
    
    self.salePrice.text  = [NSString stringWithFormat:@"-%@元",entity.DjqPrice.stringValue];
    
    // 实际支付价格
    self.price.text     = [NSString stringWithFormat:@"%@元", entity.PayTickeOrderPrice.stringValue];
    
    // 订单状态
    [self setOrderStatusText:entity.PayStatus];
}

/**
 *  // 1-已支付，2-待支付，3-已退款，4-已取消
 *
 *  @param orderStatus 
 */
-(void)setOrderStatusText:(NSInteger)orderStatus{
    if (orderStatus == 1) {
        self.status.text = @"已支付";
    }else if (orderStatus == 2){
        self.status.text = @"待支付";
    }else if (orderStatus == 3){
        self.status.text = @"已退款";
    }else if (orderStatus == 4){
        self.status.text = @"已取消";
    }
}

@end
